<%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2021/5/22
  Time: 15:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>增加评论</title>
    <style>
        #main{
            width: 800px;
            margin: 100px auto;
            border: 1px solid red;
        }
        #main div{
            text-align: center;
        }
        table{
            width: 800px;
            text-align: center;
        }
    </style>
</head>
<body>
<div id="main">
    <div>
        <h1>增加评论</h1>
        <div>
            <form action="/comment/add" method="post">
                <table>

                    <tr>
                        <td><input type="hidden" name="newsid" value="${sessionScope.newsid}"> </td>
                    </tr>
                    <%--<tr>
                        <td>图书编号:</td>
                        <td><input type="text" name="categoryid" /></td>
                    </tr>
                    <tr>
                        <td>图书名称:</td>
                        <td><input type="text" name="title" /></td>
                    </tr>--%>
                    <tr>
                        <td>评论内容:</td>
                        <td><textarea type="text" name="content"></textarea></td>
                        <%--<td><input type="text" name="summary" /></td>--%>
                    </tr>
                    <tr>
                        <td>评论人:</td>
                        <td><input type="text" name="author" />
                        </td>
                    </tr>
                   <%-- <tr>
                        <td>上传时间:</td>
                        <td><input type="text" name="createdate" /><span>(yyyy-MM-dd)</span></td>
                    </tr>--%>
                    <%--<tr>
                        <td>操作:</td>
                        <td>
                            <select name="id">
                                <option value="0">--请选择--</option>
                                <c:forEach items="${sessionScope.ebookCategorys}" var="ebookCategory">
                                    <option value="${ebookCategory.id}">${ebookCategory.name}</option>
                                </c:forEach>
                            </select>
                        </td>
                    </tr>--%>
                    <tr>
                        <td colspan="2">
                            <input type="submit" value="提交" />
                            <input type="button" value="返回" id="back" />
                            <%--<a href="/ebookentry/doemplist">返回</a>--%>
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
</body>
<script src="/js/jquery-1.8.3.min.js"></script>
    <script>
        $(function () {//获取表单并跳转
            $("#back").click(function () {
                var url="/comment/comlist";
                location.href=url;
            });
        });
    </script>
</html>
